![]() |
Precise iOS Toolkit
2.13.0
|
#import <PBSmartcard.h>
Public Member Functions | |
| (PBSmartcardStatus) | - open |
| (PBSmartcardStatus) | - openWithDisabledBackgroundManagement |
| (PBSmartcardStatus) | - close |
| (PBSmartcardStatus) | - connect: |
| (PBSmartcardStatus) | - disconnect: |
| (PBSmartcardStatus) | - reconnect:withSlotAction: |
| (PBSmartcardStatus) | - transmit:withCommandLength:andResponseBuffer:andResponseLength: |
| (PBSmartcardSlotStatus) | - getSlotStatus |
| (PBSmartcardSlotStatus) | - DEPRECATED_ATTRIBUTE |
| (PBSmartcardProtocol) | - getCurrentProtocol |
| (PBSmartcardProtocol) | - DEPRECATED_ATTRIBUTE |
| (NSArray *) | - getATR |
| (void) | - smartcardInserted: |
| (void) | - smartcardRemoved: |
| (void) | - accessoryConnected: |
| (void) | - accessoryDisconnected: |
Static Public Member Functions | |
| (NSString *) | + stringFromStatus: |
Class containing the main Smartcard operations.
PBSmartCard generates the following notifications: PB_CARD_INSERTED PB_CARD_REMOVED The application can register for these notifications by adding itself as an observer on the NSNotificationCenter object (note that sender object must be set to nil): [[NSNotificationCenter defaultCenter] addObserver:myObject selector:(mySelector:) name:"PB_CARD_INSERTED" object:nil];
The initial state of the slot can be checked with "slotStatus" which is updated when PBSmartcard is initialized.
Definition at line 135 of file PBSmartcard.h.
| - (void) accessoryConnected: | (NSNotification *) | notification |
DEPRECATED. Use notification PBAccessoryDidConnectNotification instead (documented in PBAccessory.h).
| - (void) accessoryDisconnected: | (NSNotification *) | notification |
DEPRECATED. Use notification PBAccessoryDidDisconnectNotification instead (documented in PBAccessory.h).
| - (PBSmartcardStatus) close |
Closes the library and disables all notifications. Property values are no longer reliable.
| - (PBSmartcardStatus) connect: | (PBSmartcardProtocol) | preferredProtocol |
Connects to a card in the reader using a specified protocol. The card will be open exclusively for this process until released with a call to disconnect:.
| [in] | preferredProtocol | The preferred protocol for further communication. |
| - (PBSmartcardSlotStatus) DEPRECATED_ATTRIBUTE |
DEPRECATED, use getSlotStatus.
| - (PBSmartcardProtocol) DEPRECATED_ATTRIBUTE |
DEPRECATED, use getCurrentProtocol.
| - (PBSmartcardStatus) disconnect: | (PBSmartcardDisposition) | disposition |
Disconnect from a previous call to connect: allowing other applications to access the card. Allows the caller to set the card in a preferred disposition for the next caller.
| [in] | disposition | The disposition of the card in the reader. |
| - (NSArray*) getATR |
Returns the card ATR stored as an array of NSNumber.
| - (PBSmartcardProtocol) getCurrentProtocol |
Returns the protocol used by the currently connected card, if any.
| - (PBSmartcardSlotStatus) getSlotStatus |
Returns the current slot status of the card reader.
| - (PBSmartcardStatus) open |
Initializes the library and enables notifications and PBSmartcard property values.
| - (PBSmartcardStatus) openWithDisabledBackgroundManagement |
Does the same initializations as open but also disables the automatic background management in the library. This method should only be used when an application expliciteley need to manage smart card operations in the background. See the document "Precise iOS Toolkit Smart Card Reader User Manual" for more details on the automatic background management in the library. This method requires at least iOS 5.x. Calling the method on iOS version < 5.x will return PBSmartcardStatusNotSupported.
| - (PBSmartcardStatus) reconnect: | (PBSmartcardProtocol) | preferredProtocol | |
| withSlotAction: | (PBSmartcardReset) | resetType | |
Resets and reconnects to the card in the reader. This can be used to select a different interface on the card (if supported).
| [in] | preferredProtocol | The preferred protocol to use for further communication. |
| [in] | resetType | The type of reset of the card to be performed. |
| - (void) smartcardInserted: | (NSNotification *) | notification |
"Protected method", should only be used if subclassing PBSmartcard. The subclass may override this method and act accordingly, as long as [super smartcardInserted] is called. This method will be called when a smartcard is inserted in the reader.
| - (void) smartcardRemoved: | (NSNotification *) | notification |
"Protected method", should only be used if subclassing PBSmartcard. The subclass may override this method and act accordingly, as long as [super smartcardRemoved] is called. This method will be called when a smartcard is removed from the reader.
| + (NSString*) stringFromStatus: | (PBSmartcardStatus) | status |
Converts a smartcard status code to a readable string.
| - (PBSmartcardStatus) transmit: | (unsigned char *) | command | |
| withCommandLength: | (unsigned short) | commandLength | |
| andResponseBuffer: | (unsigned char *) | response | |
| andResponseLength: | (unsigned short *) | responseLength | |
Transmits an APDU to the card and retrieves the result of the command from the card.
| [in] | command | The command APDU to send to the card |
| [in] | commandLength | The size of the command in bytes. |
| [out] | response | Pointer to the response APDU from the card. This memory must be allocated by the calling application. |
| [in,out] | responseLength | Supplies the length in bytes of the response parameter and received the actual number of bytes received from the smart card. |
1.8.1.1